<div class="container-fluid" style="margin: 0px 15px 0px 15px;">
	<?php
	//PERMISSAO 
	/*echo '<pre>';
	print_r($this->session->all_userdata());
	echo '</pre>';
	*/
	if(viewPermissao(array('1','2','3','4'),$session_data)){
	?>
	<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
	<br/>
	<div id="containerred" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
	<br/>
	<div id="container1" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
	<br/>
	<div id="container3" style="min-width: 310px; height: 400px; max-width: auto; margin: 0 auto"></div>
	<?php
	}
	?>
</div>
<div class="modal bs-example-modal-lg" id="myassunto" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">		
		<form class='form-horizontal' role='form' id='form_assunto' method="POST">
            <div class="modal-header btn-danger" >
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                 <h4 class="modal-title">Aviso - Processos</h4>

            </div>
            <div class="modal-body">
			
				<p>
				<span style="color:red;">AVISO</span> - SEUS PROCESSO QUE FORAM REDISTRIBUÍDOS DURANTE SUA AUSÊNCIA RETORNARAM.
				</p>
				FAVOR VERIFICAR!
			
				
			</div>
				<div class="modal-footer">
				<a href="#" type="button"  data-dismiss="modal" class="btn btn-danger">Fechar</a>
				</div>
		</form>
    </div>
        <!-- /.modal-content -->
		
    </div>
    <!-- /.modal-dialog -->
</div>
</body>
</html>
<script src="<?php echo base_url('includes/highcharts/js/highcharts.js')?>"></script>
<script src="<?php echo base_url('includes/highcharts/js/modules/exporting.js')?>"></script>

<script type="text/javascript">
$(function () {
	var valor = "<?php echo $this->session->userdata('error_lock'); ?>";
	if(valor == 1){
		$(window).load(function(){
			$('#myassunto').modal('show');
		});
	}
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: 'Distribuição de Processos'
        },
        subtitle: {
            text: 'Fonte: Disproju'
        },
        xAxis: {
            categories: <?php echo $usuario;?>
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Quantidade'
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: [{
            name: 'Administrativo',
            data: <?php echo $adm;?>

        }, {
            name: 'Judicial',
            data: <?php echo $jud;?>

        }, {
            name: 'Execução Fiscal',
            data: <?php echo $exec;?>

        }]
    });
	$('#containerred').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: 'Redistribuição de Processos'
        },
        subtitle: {
            text: 'Fonte: Disproju'
        },
        xAxis: {
            categories: <?php echo $usuariored;?>
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Quantidade (processos)'
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: [{
            name: 'Administrativo',
            data: <?php echo $admred;?>

        }, {
            name: 'Judicial',
            data: <?php echo $judred;?>

        }, {
            name: 'Execução Fiscal',
            data: <?php echo $execred;?>

        }]
    });
	$('#container1').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Total de Processos'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.y:.1f}</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
						format: '<b>{point.name}</b>: {point.y:.1f} ',
						style: {
							color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
						}
                    },
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: 'Quantidade',
                data: <?php echo $graf2;?>
            }]
        });
	$('#container3').highcharts({
		title: {
			text: 'Quantidade de Processos <?php echo date('Y');?>',
			x: -20 //center
		},
		subtitle: {
			text: 'Fonte: Proju',
			x: -20
		},
		xAxis: {
			categories: ['Jan', 'Fev', 'Mar', 'Abr', 'Maio', 'Jun','Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'	]
		},
		yAxis: {
			title: {
				text: 'Quantidade (processos)'
			},
			plotLines: [{
				value: 0,
				width: 1,
				color: '#808080'
			}]
		},
		tooltip: {
			valueSuffix: ' processos'
		},
		legend: {
			layout: 'vertical',
			align: 'right',
			verticalAlign: 'middle',
			borderWidth: 0
		},
		series: [
			{
				name: 'ADM',
				data: <?php echo $mesadm;?>
			},
			{
				name: 'JUD',
				data: <?php echo $mesjud;?>
			}, 
			{
				name: 'EXEC',
				data: <?php echo $mesexec;?>
			}
		]
	});
});
</script>